package cn.User;

import cn.operate.*;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-24
 * Time:14:13
 */
public class AdminUser extends User{

    public AdminUser(String name) {
        super(name);
        this.ioPerations=new IOPeration[]{  new ReturnOperation() , new FindOperation(),new AddOperation(),
                new DeleteOperation(),new ShowOperation()};
    }
    @Override
    public int menu() {
        System.out.println("**************管理员菜单*************");
        System.out.println("*****1.查找图书     2.添加图书********");
        System.out.println("*****3.删除图书     4.显示图书********");
        System.out.println("***********0.退出系统！**************");
        Scanner sc=new Scanner(System.in);
        System.out.println("你的选择——> ");
        int choice=sc.nextInt();
        while(true) {
            if (choice >= 5) {
                System.out.println("输入错误,重新选择");
                choice=sc.nextInt();
            }
            else break;
        }
        return choice;
    }

}
